package autoproperties;

import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

import org.apache.log4j.Logger;

class KeeperProperties {

	private Properties property = new Properties();
	private static final String SORRY = "Sorry properties file not found";
	private static KeeperProperties keeper_properties;
	private Logger log = Logger.getLogger(KeeperProperties.class);
	private Boolean garageProperty = false;
	private Boolean shiftProperty = false;
	private Boolean deleteProperty = false;
	private String filePath;

	private KeeperProperties() {
		try {
			property.load(new FileReader("test.properties"));
			garageProperty = property.get("garageManager").equals("true");
			shiftProperty = property.get("shiftTimeOrder").equals("true");
			deleteProperty = property.get("deleteOrder").equals("true");
			filePath = property.getProperty("url");
		} catch (IOException e) {
			log.error(SORRY);
		}

	}

	public static KeeperProperties getInstance() {
		if (keeper_properties == null) {
			keeper_properties = new KeeperProperties();
		}
		return keeper_properties;
	}

	public Boolean getGarageProperties() {
		return garageProperty;
	}

	public Boolean shiftProperty() {
		return shiftProperty;
	}

	public Boolean deleteProperty() {
		return deleteProperty;
	}

	public String getFilePath() {
		return filePath;

	}

}
